package com.jee.support.io;

import java.io.IOException;

public class ReadChunk {
	public static void main(String[] args) {
		try {
		  byte[] b = new byte[100];
		  int offset = 0;
		  while (offset < b.length) {
		    int bytesRead = System.in.read(b, offset, b.length - offset);
		    if (bytesRead == -1) break; // end of stream
		    offset += bytesRead;
		  }
		}
		catch (IOException ex) {
		  System.err.println("Couldn't read from System.in!");
		}
	}
}

